<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            var num1 = prompt("请输入第一个数字");
            var num2 = prompt("请输入第二个数字");
            num1 = parseInt(num1);
            num2 = parseInt(num2);
            var add = num1+num2;
            return add;
        }
        // var adds = f();
        console.log("两数之和："+f());
    </script>
</head>
<body>

</body>
</html>